using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace IGGCore
{
    /// <summary>
    /// IGG Core Constants
    /// It contains mostly dates and urls
    /// </summary>
    public class CoreConstants
    {
        public static string TEMP
        {
            get
            {
                String path = Path.GetFullPath(Environment.GetEnvironmentVariable("TEMP", EnvironmentVariableTarget.Machine));

                if (String.IsNullOrEmpty(path))
                {
                    path = (Directory.Exists(@"C:\Temp")) ? @"C:\Temp" : @"C:\Windows\Temp";
                }

                return path;
            }
        }

        // mlb dates
        public static DateTime SEASON_START = new DateTime(DateTime.Now.Year, 03, 28);

        // time & delays
        private const int SECOND = 1000;
        private const int MINUTE = 60 * SECOND;

        // files
        public const string FILE_PATH_HISTORY = "\\DataFiles\\history.xml";
        public const string FILE_PATH_JAMES = "\\DataFiles\\BillJames.xml";
        public const string FILE_PATH_PROSPECTS = "\\DataFiles\\Prospects.txt";

        // http://hardballtalk.nbcsports.com/2011/04/05/and-that-happened-mondays-scores-and-highlights-32
        // http://hardballtalk.nbcsports.com/2011/04/06/and-that-happened-tuesdays-scores-and-highlights-40
        // http://hardballtalk.nbcsports.com/2011/04/07/and-that-happened-wednesdays-scores-and-highlights-34

        // mlb urls
        public const string MLB_ONLINE_BASE_URL = "http://gd2.mlb.com/components/game/mlb";
        public const string UBER_SCOREBOARD_URL = "uber_scoreboard.xml";
        public const string PLAYS_URL = "plays.xml";
        public const string NOTIFICATIONS_URL = "notifications_full.xml";
        public const string BOXSCORE_URL = "boxscore.xml";
        public const string PLAYERS_URL = "players.xml";
        public const string GAMEDAY_URL = "gameday_Syn.xml";
        public const string STANDINGS_BASE_URL = "http://www.mlb.com/components/game";
        public const string STANDINGS_ALE_URL = "standings_rs_ale.js";
        public const string STANDINGS_ALC_URL = "standings_rs_alc.js";
        public const string STANDINGS_ALW_URL = "standings_rs_alw.js";
        public const string STANDINGS_NLE_URL = "standings_rs_nle.js";
        public const string STANDINGS_NLC_URL = "standings_rs_nlc.js";
        public const string STANDINGS_NLW_URL = "standings_rs_nlw.js";
        public const string STANDINGS_NATIONAL_WILDCARD_URL = "standings_rs_nlwc.js";
        public const string STANDINGS_AMERICAN_WILDCARD_URL = "standings_rs_alwc.js";
        public const string STATS_USATODAY = "http://content.usatoday.com/sportsdata/baseball/mlb/stats/leaders";

        public const string STAT_BBREF_NLBAT = "http://www.baseball-reference.com/leagues/NL/yyyy-batting-leaders.shtml";
        public const string STAT_BBREF_ALBAT = "http://www.baseball-reference.com/leagues/AL/yyyy-batting-leaders.shtml";
        public const string STAT_BBREF_NLPITCH = "http://www.baseball-reference.com/leagues/NL/yyyy-pitching-leaders.shtml";
        public const string STAT_BBREF_ALPITCH = "http://www.baseball-reference.com/leagues/AL/yyyy-pitching-leaders.shtml";
        public const string STAT_BBREF_NLFIELD = "http://www.baseball-reference.com/leagues/NL/yyyy-fielding-leaders.shtml";
        public const string STAT_BBREF_ALFIELD = "http://www.baseball-reference.com/leagues/AL/yyyy-fielding-leaders.shtml";

        // news url
        public const string NEWS_URL_MLB = "http://mlb.mlb.com/partnerxml/gen/news/rss/mlb.xml";
        public const string NEWS_URL_YAHOO = "http://sports.yahoo.com/mlb/rss.xml";
        public const string NEWS_URL_DUK = "http://sports.yahoo.com/mlb/blog/big_league_stew/rss.xml";
        public const string NEWS_URL_ESPN = "http://sports.espn.go.com/espn/rss/mlb/news";
        public const string NEWS_URL_CNNSI = "http://rss.cnn.com/rss/si_mlb.rss";
        public const string NEWS_URL_SPORTSLINE = "http://www.sportsline.com/partners/feeds/rss/mlb_news";
        
        // bases
        public const int FIRST_BASE = 0;
        public const int SECOND_BASE = 1;
        public const int THIRD_BASE = 2;

        // positions
        public const int POSITION_PITCHER = 0;
        public const int POSITION_CATCHER = 1;
        public const int POSITION_1B = 2;
        public const int POSITION_2B = 3;
        public const int POSITION_SS = 4;
        public const int POSITION_3B = 5;
        public const int POSITION_LF = 6;
        public const int POSITION_CF = 7;
        public const int POSITION_RF = 8;

        public const int POSITION_BATTER = 9;
        public const int POSITION_RUNNER_FIRST = 10;
        public const int POSITION_RUNNER_SECOND = 11;
        public const int POSITION_RUNNER_THIRD = 12;
    }
}
